<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Calendar Page</title>
        <h:outputStylesheet library="css" name="stylesheet.css" />
        
    </h:head>
    <h:body>
        <header>
            <h1 id="title">MeteoCal</h1>
            <h:form id="searchForm" class="float-left">
                <p:inputText value="#{searchBean.searchInput}" id="keyword" maxlength="200"/>
                <p:commandButton class="searchUsersButton" action="#{searchBean.findUser()}" icon="ui-icon-search"/>
                <p:watermark for="keyword" value="Search..." id="watermark" />
            </h:form>
            <ul id="landmarks">
                <li><p:link outcome="home" value="#{homeBean.name}'s Calendar"  style="color:white"/></li>
                <li><p:link outcome="notifications" value="Notifications (#{notificationBean.getNumberOfNotifies()})"/></li>
                <li><p:link outcome="addressbook" value="Addressbook"/></li>
                <li><p:link outcome="settings" value="Settings"/></li>
                <li><h:form><p:commandLink action="#{indexBean.logout()}" value="Logout"/></h:form></li>
            </ul>
        </header>
        <section>
                       
            <h:form>
                <p:growl id="growl" showDetail="true" life="3000"/>
            </h:form>
            <div style="width:1024px;margin:auto;margin-bottom: 50px;">
                <h:form>
                    <p:commandButton style="margin-bottom: 10px;"
                                     action="createevent?faces-redirect=true"
                                     value="Create New Event" />
                </h:form>

                <h:form>
                    <p:schedule id="schedule" value="#{homeScheduleBean.scheduleModel}" widgetVar="myschedule"
                                draggable="false" resizable="false" axisFormat="H(:mm)" timeFormat="H(:mm)"
                                firstHour="0" showWeekends="true">


                        <p:ajax event="eventSelect" listener="#{homeScheduleBean.onEventSelect}"
                                update="eventDetails" oncomplete="PF('eventDialog').show();" />

                    </p:schedule>


                    <p:dialog widgetVar="eventDialog" header="Event Details" showEffect="clip" hideEffect="clip">
                        <h:panelGrid id="eventDetails" columns="2" style="font-size: 15px;">

                            <p:outputLabel value="Name : "/>
                            <p:outputLabel value="#{homeScheduleBean.currentEvent.name}"/>

                            <p:outputLabel value="Description : "/>
                            <p:outputLabel value="#{homeScheduleBean.currentEvent.description}"/>

                            <p:outputLabel value="Start Time : "/>
                            <p:outputLabel value="#{homeScheduleBean.currentEvent.beginTime}"/>

                            <p:outputLabel value="End Time : "/>
                            <p:outputLabel value="#{homeScheduleBean.currentEvent.endTime}"/>

                            <p:outputLabel value="Location : "/>
                            <p:outputLabel value="#{homeScheduleBean.currentEvent.location}"/>

                            <p:outputLabel value=""/>
                            <p:commandButton id="goButton" value="Go to Event Page"
                                            
                                            action="/event?faces-redirect=true"/>
                        </h:panelGrid>
                    </p:dialog>
                </h:form>
            </div>
        </section>
    </h:body>
</html>

